from threading import Thread
from threading import local
import time
from threading import get_ident
# 特殊的对象
xianglong = local()  # 单独的为每个线程创建出一个空间


def task(arg):
    # 对象.val = 1/2/3/4/5
    xianglong.value = arg
    time.sleep(1) # 亲亲翔龙
    print(xianglong.value)


for i in range(10):
    t = Thread(target=task,args=(i,))
    t.start()

"""
96
2

7
0
8
5
1
3
4

进程已结束，退出代码为 0
"""